using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Overlay
{
    /// <summary>
    /// <para>Update</para>
    /// <para>Computes the geometric intersection of the Input Features and Update Features. The attributes and geometry of the input features are updated by the update features in the output feature class.</para>
    /// <para>计算输入要素和更新要素的几何交集。输入要素的属性和几何由输出要素类中的更新要素进行更新。</para>
    /// </summary>    
    [DisplayName("Update")]
    public class Update : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Update()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input feature class or layer. The geometry type must be polygon.</para>
        /// <para>输入要素类或图层。几何类型必须为多边形。</para>
        /// </param>
        /// <param name="_update_features">
        /// <para>Update Features</para>
        /// <para>The features that will be used to update the input features. The geometry type must be polygon.</para>
        /// <para>将用于更新输入要素的功能。几何类型必须为多边形。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class to contain the results.</para>
        /// <para>要包含结果的要素类。</para>
        /// </param>
        public Update(object _in_features, object _update_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._update_features = _update_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Update";

        public override string CallName => "analysis.Update";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "parallelProcessingFactor", "qualifiedFieldNames"];

        public override object[] ParameterInfo => [_in_features, _update_features, _out_feature_class, _keep_borders.GetGPValue(), _cluster_tolerance];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input feature class or layer. The geometry type must be polygon.</para>
        /// <para>输入要素类或图层。几何类型必须为多边形。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Update Features</para>
        /// <para>The features that will be used to update the input features. The geometry type must be polygon.</para>
        /// <para>将用于更新输入要素的功能。几何类型必须为多边形。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Update Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _update_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class to contain the results.</para>
        /// <para>要包含结果的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Borders</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the boundary of the update polygon features will be kept.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The outside border of the Update Features will be kept in the Output Feature Class. This is the default option.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The outside border of the Update Features are dropped after they are inserted into the Input Features. Item values of the Update Features take precedence over Input Features attributes.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否保留更新面要素的边界。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 更新要素的外部边界将保留在输出要素类中。这是默认选项。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将更新要素的外部边框插入到输入要素中后将其删除。“更新要素”的条目值优先于“输入要素”属性。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Borders")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _keep_borders_value _keep_borders { get; set; } = _keep_borders_value._true;

        public enum _keep_borders_value
        {
            /// <summary>
            /// <para>BORDERS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("BORDERS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_BORDERS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_BORDERS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>XY Tolerance</para>
        /// <para><xdoc>
        ///   <para>The minimum distance separating all feature coordinates (nodes and vertices) as well as the distance a coordinate can move in X or Y (or both).</para>
        ///   <para>Changing this parameter's value may cause failure or unexpected results. It is recommended that this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>分隔所有要素坐标（节点和折点）的最小距离，以及坐标可以在 X 或 Y（或两者）中移动的距离。</para>
        ///   <para>更改此参数的值可能会导致失败或意外结果。建议不要修改该参数。它已从工具对话框的视图中删除。默认情况下，将使用输入要素类的空间参考 x，y 容差属性。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("XY Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _cluster_tolerance { get; set; } = null;


        public Update SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object parallelProcessingFactor = null, bool? qualifiedFieldNames = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, parallelProcessingFactor: parallelProcessingFactor, qualifiedFieldNames: qualifiedFieldNames);
            return this;
        }

    }

}